﻿using System.Reflection;
using MyCoreLib.Automation.Data.SqlClient.Metadata;
using MyCoreLib.Automation.Data.SqlClient.Model;

namespace MyCoreLib.Automation.Examples
{
    using System;
    using System.Configuration;
    using System.Diagnostics;
    using System.IO;
    using System.Threading;
    using Data.SqlClient;

    class Program
    {
        static Program()
        {
            var dataDirectory = ConfigurationManager.AppSettings["DataDirectory"];
            Debug.Assert(!string.IsNullOrWhiteSpace(dataDirectory), "DataDirectory appSettings value is missing");
            var dataDirectoryInfo = new DirectoryInfo(dataDirectory);
            Debug.Assert(dataDirectoryInfo.Exists, "{0} DataDirectory does not exist.", dataDirectory);
            AppDomain.CurrentDomain.SetData("DataDirectory", dataDirectoryInfo.FullName);
        }

        static void Main(string[] args)
        {

            var connectionString = @"Data Source=localhost;Initial Catalog=AdventureWorks2012;Integrated Security=True";
            //var connectionString = ConfigurationManager.ConnectionStrings["AdventureWorks"].ConnectionString;

            var output = new ConsoleOutput();
            var selection = new GenericSelection();

            selection.DefaultConnectionString = connectionString;

            var schemaInfo = SelectionInfo.Create(output, selection);
            
        }
    }
}
